﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MossmanMill.Controller
{
    /// <summary>
    /// Import Factory Class
    /// </summary>
    /// <dates>
    /// 22/05/2012 - created by Chiaki Sato
    /// </dates>
    class ImportFactory : IImportFactory
    {
        public const string CLASS_TYPE_IMPORT = "Import";
        
        private const string ERR_MESSAGE_CLASS_NOT_FOUND = "Import Factory cannot create: {0} class";

        /// <summary>
        /// Constructor
        /// </summary>
        public ImportFactory() 
        {
        }

        /// <summary>
        /// Make each Import class
        /// </summary>
        /// <param name="name">Import type name</param>
        /// <param name="excelFileDiretory">Excel File Directory</param>
        public IImportManager Make(string name, string excelFileDiretory)
        {
            IImportManager iImportManager = null;

            switch (name)
            {

                // Create Import Manager class
                case CLASS_TYPE_IMPORT:
                    iImportManager = new ImportManager(excelFileDiretory);
                    return iImportManager;

                default:
                    throw new Exception(String.Format(ERR_MESSAGE_CLASS_NOT_FOUND, name));
            }
        }
    }
}
